import { request } from '@/utils/request'
import { findByStorageKey } from '@/utils/localStorageUtil'
//登录接口
export const uploadFiles = (data: any) => {
  const accessToken = findByStorageKey('accessToken')
  const formData = new FormData()
  formData.append('file', data)
  return request.post('/file/upload', formData, {
    headers: {
      'Content-Type': 'multipart/form-data',
      // 设置正确的请求头格式
      Authorization: `Bearer ${accessToken}`,
      accessToken: accessToken
    }
  })
}
